package simple_factory_pattern.v1;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入数字a: ");
        String a = sc.next();
        System.out.print("请选择运算符号（+、-、*、/）: ");
        String b = sc.next();
        System.out.print("请选择数字b: ");
        String c = sc.next();
        String d = "";
        if (b.equals("+")) {
            d = Double.parseDouble(a) + Double.parseDouble(c) + "";
        }
        if (b.equals("-")) {
            d = Double.parseDouble(a) - Double.parseDouble(c) + "";
        }
        if (b.equals("*")) {
            d = Double.parseDouble(a) * Double.parseDouble(c) + "";
        }
        if (b.equals("/")) {
            d = Double.parseDouble(a) / Double.parseDouble(c) + "";
        }
        System.out.println("结果是: " + d);
    }
}
